CC = aarch64-linux-gnu-gcc
#指定内核源码主目录
KER_DIR = /home/robin/work/kernel-rockchip-nanopi4-linux-v4.4.y
#指定模块程序所在的目录
CUR_DIR = $(shell pwd)
#指定源文件列表和应用名
SRC = coord.c coord_thread.c do_cmd.c linkqueue.c main.c mob_thread.c outqueue_thread.c
APP = server
#指定驱动程序名
DRV = led_drv

all:
	make -C $(KER_DIR) M=$(CUR_DIR) modules
	$(CC) -o $(APP) $(SRC)  -lm -lpthread -lsqlite3 -I /home/robin/work/temp/install/include/ -L /home/robin/work/temp/install/lib/

clean:
	make -C $(KER_DIR) M=$(CUR_DIR) clean
	$(RM) $(APP) Module.symvers

install:
	scp $(DRV).ko $(APP) root@192.168.104.221:/drv/iot



#指定模块程序所在的目录下哪些文件作为模块程序来编译
obj-m = $(DRV).o

